//
//  YXMoreAboutViewController.m
//  MockProject
//
//  Created by 周丽丽 on 16/8/24.
//  Copyright © 2016年 niuzhaowang. All rights reserved.
//

#import "YXMoreAboutViewController.h"

@interface YXMoreAboutViewController ()
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UIImageView *titleImageView;
@property (nonatomic, strong) UILabel *versionLabel;
@end

@implementation YXMoreAboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"关于我们";
    self.view.backgroundColor = [UIColor colorWithHexString:@"ffffff"];
    [self setupBackButton];
    [self setupSubviews];
    [self setupSubviewsLayout];
}
- (void)setupSubviews{
   UIImageView *iconImageV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"关于我们大icon"]];
    [self.view addSubview:iconImageV];
    self.iconImageView = iconImageV;
    
    UIImageView *titleImageV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"MOCK-PROJECT"]];
    [self.view addSubview:titleImageV];
    self.titleImageView = titleImageV;
    
    UILabel *versionLbl = [[UILabel alloc]init];
    versionLbl.text = @"当前版本1.0";
    versionLbl.textColor = [UIColor colorWithHexString:@"ff4600"];
    versionLbl.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:versionLbl];
    self.versionLabel = versionLbl;
}
- (void)setupSubviewsLayout{
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.centerY.equalTo(self.view).offset(-44);
    }];
    [self.titleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.iconImageView.mas_bottom).offset(27);
        make.centerX.equalTo(self.view);
    }];
    [self.versionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleImageView.mas_bottom).offset(11);
        make.centerX.equalTo(self.view);
    }];
}
- (void)setupBackButton{
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn.frame = CGRectMake(0, 0, 30, 30);
    [backBtn setImage:[UIImage imageNamed:@"返回按钮正常态"] forState:UIControlStateNormal];
    [backBtn setImage:[UIImage imageNamed:@"返回按钮-点击态"] forState:UIControlStateSelected];
    [backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = backItem;
}
-(void)doBack:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
